<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
if (isset($_SESSION['lang']))
    require_once "./language_files/viewAssignedReviewers_" . $_SESSION['lang'] . ".php";
else
    require_once "./language_files/viewAssignedReviewers_en.php";
?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=9" />
        <link href="style3.css" rel="stylesheet" type="text/css" />
        <?php include 'jquery.php'; ?>
        <script type="text/javascript" src="functions.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                check_top();
            });
        </script>
        <title></title>
    </head>
    <body>
        <?php
        require_once "functions.php";
        if (isset($_GET['conference_id'])) { // checking if the paper id and title and the conference id are passed from the previous
            // saving these values in variables
            $i = intval($_GET['paper_id']);
            $id = mysql_real_escape_string($i);
            $c = intval($_GET['conference_id']);
            $confid = mysql_real_escape_string($c);
            $t = get_paper_title($id);
            $title = formatText_safe($t);
            $confname = get_conference_name($confid);
            echo"</br><span class=breadcrumbs><a href='subscriberConferencePage.php?conference_id={$confid}'>" . $confname . "</a>" . " > " . $lang['view'] . "</span> </br></br>";
            print "<h1>{$title}</h1>"; //printing the paper's title as the header of the page
            //estsblishing a database connection

            //execute the query that gets all the data needed from the database
            $get_data = mysql_query("SELECT first_name , last_name
                 FROM  member m , assigned_papers a
                 WHERE m.member_id = a.member_id
                 AND a.paper_id= $id ;") or die(mysql_error());
            if (mysql_num_rows($get_data) == 0) {
                echo $lang['error_1'];
            } else if (mysql_num_rows($get_data) > 1) {

                echo '<table width="100%">
                <tr>
                    <td><b>' . $lang['reviewers'] . '</b></td>
                </tr>';
                //Print each reviewer's name
                while ($row = mysql_fetch_assoc($get_data)) {
                    $f_name = formatText_safe($row['first_name']);
                    $l_name = formatText_safe($row['last_name']);
                    echo "
                <tr>
                    <td>{$f_name} {$l_name}</td>
                    </tr>";
                }
                // Close table
                echo '</table>';
            }
        }
        else
            echo $lang['error_2'];
        ?>
    </body>
</html>